class Singleton:
    _instance =None
    def __new__(cls, *args, **kwargs):
        if not cls._instance:
           cls._instance=super().__new__(cls,*args, **kwargs)
        return cls._instance

#一个类只有一个对象
s1 =Singleton()
s2 =Singleton()
s3 =Singleton()
s4 =Singleton()
s5 =Singleton()
print(s1)
print(s2)
print(s3)
print(s4)
print(s5)
